export default [
  {
    path: '/user',
    layout: false,
    routes: [{ name: '登录', path: '/user/login', component: '@/pages/User/Login' }],
  },
  { path: '/welcome', name: '欢迎', icon: 'smile', component: '@/pages/Welcome' },
  // 管理员模块
  {
    path: '/admin',
    name: '管理页',
    icon: 'crown',
    access: 'canAdmin',
    routes: [
      // 这里的redirect 是访问/admin的时候重定向的路由
      { path: '/admin', redirect: '/admin/user' },
      { path: '/admin/user', name: '用户管理页', component: '@/pages/Admin/ManageUser' },
      { path: '/admin/class', name: '班级管理页', component: '@/pages/Admin/ManageClass' },
      { path: '/admin/course', name: '课程管理页', component: '@/pages/Admin/ManageCourse' },
      {
        path: '/admin/teacherCourse',
        name: '教师授课页',
        component: '@/pages/Admin/TeacherCourse',
      },
      { path: '/admin/scoreAudit', name: '成绩审核页', component: '@/pages/Admin/ScoreAudit' },
    ],
  },
  // 教师模块
  {
    path: '/teacher/score',
    name: '分数模块',
    icon: 'crown',
    access: 'isTeacher',
    component: '@/pages/Teacher/ManageScore',
  },
  // 学生
  {
    path: '/student/course',
    name: '课程信息',
    icon: 'BankOutlined',
    access: 'isStudent',
    component: '@/pages/Student/CourseInfo',
  },
  {
    path: '/student/profile',
    name: '个人信息',
    icon: 'ContactsOutlined',
    access: 'isStudent',
    component: '@/pages/Student/ProfileInfo',
  },
  {
    path: '/student/score',
    name: '成绩信息',
    icon: 'BookOutlined',
    access: 'isStudent',
    component: '@/pages/Student/ScoreInfo',
  },
  { path: '/', redirect: '/welcome' },
  { path: '*', layout: false, component: '@/pages/404' },
];
